<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
</head>
<body>
    <script>
        let num1=+prompt('输入一个数字')
        let str=prompt('输入运算符')
        let num2=+prompt('输入一个数字')
        switch (str) {
            case '+':
                alert(num1+num2)
                break;
            case '-':
                alert(num1-num2)
                break;
            case '*':
                alert(num1*num2)
                break;
            case '/':
                alert(num1/num2)
                break;
        
            default:
                alert(false)
                break;
        }
    </script>
</body>
</html>